home *** CD-ROM | disk | FTP | other *** search
- function initDiacriticalHandlers()
- {
- var bx;
- var i = 0;
- while(i < gAnswerBoxes.length)
- {
- bx = gAnswerBoxes[i];
- bx.onSetFocus = function(oldfocus)
- {
- trace("Set: What\'s this oldfocus? : " + oldfocus);
- trace("Set: What\'s this this? : " + this);
- PMSI.lastTextField = this;
- };
- bx.onKillFocus = function(newfocus)
- {
- trace("Set: What\'s this newfocus? : " + newfocus);
- trace("Set: What\'s this this? : " + this);
- PMSI.lastTextField = newfocus;
- };
- bx.onKillFocus = function()
- {
- };
- bx.onChanged = function()
- {
- PMSI.textFuncs.setReplacePos();
- };
- bx.tabEnabled = true;
- i++;
- }
- TextField.prototype.cSetFocus = function()
- {
- Selection.setFocus(this);
- };
- this.onEnterFrame = focusSetter;
- }
- function focusSetter()
- {
- if(Selection.getFocus() == null)
- {
- defaultBox.cSetFocus();
- }
- else
- {
- trace("Default focus set");
- delete this.onEnterFrame;
- }
- }
- if(_global.PMSI == null)
- {
- _global.PMSI = {};
- PMSI.VENDOR_NAME = "Purple Monkey Studios, Inc.";
- PMSI.DefList = {};
- }
- PMSI.textFuncs = {};
- PMSI.lastTextField = null;
- PMSI.textFuncs.setReplacePos = function()
- {
- var ltf = PMSI.lastTextField;
- ltf._lastCaretIndex = Selection.getCaretIndex();
- ltf._startSel = Selection.getBeginIndex();
- ltf._endSel = Selection.getEndIndex();
- if(__DEBUG)
- {
- trace("Last caret index: " + ltf._lastCaretIndex);
- trace("Start selection: " + ltf._startSel);
- trace("End selection: " + ltf._endSel);
- }
- };
- PMSI.textFuncs.replaceSel = function(s)
- {
- var ltf = PMSI.lastTextField;
- Selection.setFocus(ltf);
- Selection.setSelection(ltf._startSel,ltf._endSel);
- ltf.replaceSel(s);
- };
-